<template>
	<view>
		<view class="search-container" :style="{'background-color': bgcolor}">
		  <view class="search-box" :style="{'border-radius': radius +'px'}" @click="searchBox">
		    <uni-icons type="search" size="17"></uni-icons>
        <text class="text">搜索</text>
		  </view>
		</view>
	</view>
</template>

<script>
	export default {
    // 通过属性绑定的方式增加组件的通用性
    props:{
      bgcolor: {
        type: String,
        default: "#c00000"
      },
      radius: {
        type: Number,
        default: 15
      }
    },
		data() {
			return {
				
			};
		},
    methods: {
      searchBox () {
        this.$emit('click')
      }
    }
	}
</script>

<style lang="scss">
.search-container{
  height: 50px;
  .search-box{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 36px;
    background-color: #FFFFFF;
    .text{
      font-size: 12px;
    }
  }
}
</style>
